import upload from "@/utils/upload";
import request from "@/utils/request";

// 获取用户信息
export function getUserInfo(userId) {
  return request({
    url: "/pet/p_user/minapp/"+userId,
	headers: {
		isToken: true
	},
    method: "get" 
  });
}
// 修改用户信息
export function setUserInfo(data) {
	return request({
	  url: "/pet/p_user/minapp",
	  headers: {
		  isToken: true
	  },
	  method: "put" ,
	  data: data
	});
  }
  //生成邀请码
  export function createCode(query) {
    return request({
      url: '/pw/codes/create',
	  headers: {
	  		  isToken: true
	  },
      method: 'get',
      params: query
    })
  }

  //查询用户金额
  export function getUserMoney(data) {
    return request({
      url: '/pw/user/amount',
	  headers: {
	  		  isToken: true
	  },
      method: 'post',
      data: data

    })
  }
  //小程序查询个人扣款记录
  export function getDeductRecord(query) {
    return request({
      url: '/pw/work_orders/deducted_records',
	  headers: {
	  		  isToken: true
	  },
      method: 'get',
      params: query
    })
  }
  //小程序注销用户
  export function delUser(data) {
    return request({
      url: '/pw/user/logout',
	  headers: {
	  		  isToken: true
	  },
      method: 'post',
      data: data
    })
  }

  
